class FirstPage extends eui.Component implements  eui.UIComponent {
	public startBtn:eui.Button;
	public maxScoreBtn:eui.Button;
	public useBtn:eui.Button;
	public lbl2048:eui.Label;
	public logoLbl:eui.Label;

	public constructor() {
		super();

		this.addEventListener(eui.UIEvent.COMPLETE, this.onComplete, this);
		this.skinName = "resource/game/FirstPage.exml";
	}

	protected partAdded(partName:string,instance:any):void
	{
		super.partAdded(partName,instance);
	}

	protected childrenCreated():void
	{
		super.childrenCreated();
	}

	private onComplete()
	{
		this.startBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onStartBtn, this);
		this.maxScoreBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onMaxScoreBtn, this);
		this.useBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onUseBtn, this);
		SoundManager.getInstance();
		egret.Tween.get(this.lbl2048,{loop:true}).to({ alpha: 0.65}, 800).to({ alpha: 1}, 800);
	}

	private onStartBtn()
	{
		this.addChild(new GameView());
	}

	private onMaxScoreBtn()
	{
		this.addChild(new MaxScore());
	}

	private onUseBtn()
	{
		this.addChild(new MessageView("介绍", "1.每次可以选择上下左右其中一个方向去滑动\n\
		2.每滑动一次，所有的数字方块都会往滑动的方向靠拢外，系统也会随机在空白的地方增加一个数字方块\n\
		3.相同数字的方块在靠拢、相撞时会相加。不断的叠加最终拼凑出2048这个数字就算成功。", false));
	}
	
}